function bloodPressure() {
    var pageviews = [
        ["周一", 125],
        ["周二", 130],
        ["周三", 133],
        ["周四", 128],
        ["周五", 135],
        ["周六", 130],
        ["周日", 129]

    ];
    var visitors = [
        ["周一", 76],
        ["周二", 80],
        ["周三", 79],
        ["周四", 82],
        ["周五", 80],
        ["周六", 83],
        ["周日", 81]
    ];

    var plot = $.plot($("#blood_pressure_chart"), [{
        data: pageviews,
        label: "收缩压"
    }, {
        data: visitors,
        label: "舒张压"
    }
    ], {
        series: {

            lines: {
                show: true,
                lineWidth: 2,
                fill: true,
                fillColor: {
                    colors: [{
                        opacity: 0.05
                    }, {
                        opacity: 0.01
                    }
                    ]
                }
            },
            points: {
                show: true
            },
            shadowSize: 2
        },
        grid: {
            hoverable: true,
            clickable: true,
            tickColor: "#eee",
            borderWidth: 0
        },
        colors: ["#DB5E8C", "#F0AD4E", "#5E87B0"],

        xaxis: {
            mode: "categories",
            labelWidth:35,

            tickLength: 0//设置刻度

        },
        yaxis: {

            ticks: 5,
            tickDecimals: 0,
            min: 50//设置最小值

        }
    });


    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css({
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 15,
            border: '1px solid #333',
            padding: '4px',
            color: '#fff',
            'border-radius': '3px',
            'background-color': '#333',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }

    var previousPoint = null;
    $("#blood_pressure_chart").bind("plothover", function (event, pos, item) {
        $("#x").text(pos.x.toFixed(2));
        $("#y").text(pos.y.toFixed(2));

        if (item) {
            if (previousPoint != item.dataIndex) {
                previousPoint = item.dataIndex;

                $("#tooltip").remove();
                var x = item.datapoint[0].toFixed(2),
                    y = item.datapoint[1].toFixed(2);

                showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y);
            }
        } else {
            $("#tooltip").remove();
            previousPoint = null;
        }
    });
}
function bloodBMI() {
    var BMI = [
        ["周一", 25],
        ["周二", 30],
        ["周三", 33],
        ["周四", 28],
        ["周五", 35],
        ["周六", 30],
        ["周日", 29]

    ];


    var plot = $.plot($("#BMI_chart"), [BMI], {
        series: {

            lines: {
                show: true,
                lineWidth: 2,
                fill: true,
                fillColor: {
                    colors: [{
                        opacity: 0.05
                    }, {
                        opacity: 0.01
                    }
                    ]
                }
            },
            points: {
                show: true
            },
            shadowSize: 2
        },
        grid: {
            hoverable: true,
            clickable: true,
            tickColor: "#eee",
            borderWidth: 0
        },
        colors: ["#DB5E8C", "#F0AD4E", "#5E87B0"],

        xaxis: {
            mode: "categories",
            labelWidth:35,

            tickLength: 0//设置刻度

        },
        yaxis: {

            ticks: 5,
            tickDecimals: 0,
            min: 10//设置最小值

        }
    });


    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css({
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 15,
            border: '1px solid #333',
            padding: '4px',
            color: '#fff',
            'border-radius': '3px',
            'background-color': '#333',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }

    var previousPoint = null;
    $("#BMI_chart").bind("plothover", function (event, pos, item) {
        $("#x").text(pos.x.toFixed(2));
        $("#y").text(pos.y.toFixed(2));

        if (item) {
            if (previousPoint != item.dataIndex) {
                previousPoint = item.dataIndex;

                $("#tooltip").remove();
                var x = item.datapoint[0].toFixed(2),
                    y = item.datapoint[1].toFixed(2);

                showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y);
            }
        } else {
            $("#tooltip").remove();
            previousPoint = null;
        }
    });
}
function bloodFat() {
    var fat = [
        ["周一", 5.0],
        ["周二", 4.0],
        ["周三", 3.9],
        ["周四", 4.2],
        ["周五", 4.8],
        ["周六", 4.5],
        ["周日", 4.0]

    ];


    var plot = $.plot($("#blood_fat_chart"), [fat] , {
        series: {

            lines: {
                show: true,
                lineWidth: 2,
                fill: true,
                fillColor: {
                    colors: [{
                        opacity: 0.05
                    }, {
                        opacity: 0.01
                    }
                    ]
                }
            },
            points: {
                show: true
            },
            shadowSize: 2
        },
        grid: {
            hoverable: true,
            clickable: true,
            tickColor: "#eee",
            borderWidth: 0
        },
        colors: ["#DB5E8C", "#F0AD4E", "#5E87B0"],

        xaxis: {
            mode: "categories",
            labelWidth:35,

            tickLength: 0//设置刻度

        },
        yaxis: {

            ticks: 5,
            tickDecimals: 0


        }
    });


    function showTooltip(x, y, contents) {
        $('<div id="tooltip">' + contents + '</div>').css({
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 15,
            border: '1px solid #333',
            padding: '4px',
            color: '#fff',
            'border-radius': '3px',
            'background-color': '#333',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
    }

    var previousPoint = null;
    $("#blood_fat_chart").bind("plothover", function (event, pos, item) {
        $("#x").text(pos.x.toFixed(2));
        $("#y").text(pos.y.toFixed(2));

        if (item) {
            if (previousPoint != item.dataIndex) {
                previousPoint = item.dataIndex;

                $("#tooltip").remove();
                var x = item.datapoint[0].toFixed(2),
                    y = item.datapoint[1].toFixed(2);

                showTooltip(item.pageX, item.pageY, item.series.label + " of " + x + " = " + y);
            }
        } else {
            $("#tooltip").remove();
            previousPoint = null;
        }
    });
}